package practica1;

public class Funcion4 extends FuncionMultiVar{

	public Funcion4(double xMin, double xMax,
			double precision, int n) {
		super(xMin, xMax, precision, n);
		maximo = -(n*63.63498);
	}

	public double calcAptitud(double[] f) {
		double aptitud = 0;
		for (int i=0; i<n; i++) {
			aptitud += f[i] * Math.sin(Math.sqrt(Math.abs(f[i])));
		}
		return aptitud * (-1);
	}
	
}
